home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 October
/
1985-10.d64
/
farm game
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
11KB
|
321 lines
10 bo=7:bg=9:ch=1:gosub3100:poke53272,23
20 clr:gosub3110:fg=0:print"[200]ow long will you manage your farm";
30 inputqq$:qq=val(qq$):ifqq=0thengosub2930
40 iffg<>0then20
50 forzz=1toqq:gosub2110:gosub2150:ifzz=1thengosub2190
60 bo=7:bg=6:ch=1:gosub3100
70 print"[147] [217]ear:[146]";zz:print" [208]lanting season selection: [146]
80 [153][163]5)"f1 key...(NULL)arket news
90 printtab(5)"f3 key...[217]our financial status
100 [153][163]5)"f5 key...(NULL)lanting
110 printtab(5)"f7 key...[211]ell crops on futures
120 [153][163]8)"(NULL)hat is your selection?
130 gosub2950
140 ifasc(a$)<133orasc(a$)>136then130
150 aa=asc(a$)-132:onaagosub1150,1370,1520,1890
160 ifaa=3then180
170 goto60
180 bo=7:bg=7:ch=6:gosub3100
190 print"[147]":printtab(10)"[217]our crops are growing.
200 fx[178]0:[129]j[178]1[164]3:fx[178]fx[170](ts(j)[172][181]((bp(j)[172]fp(j))[172]100[170].5)[173]100):[130]
210 fx[178][181](fx[172]100[170].5)[173]100:sb[178]0
220 [129]j[178]1[164]3:sb[178]sr(j)[170]sb:[130]
230 [129]j[178]1[164]3:sr(j)[178]sr(j)[171]ts(j):[130]
240 [141]2200:[141]2360
250 gt[178]0:[129]j[178]1[164]3:gt[178]gt[170](ty(j)[172][181](yp(j)[172]100[170].5)[173]100):[130]
260 pt[178]0:[129]j[178]1[164]3:pt[178](fu(j)[172]ta(j))[170]pt:[130]:pt[178][181](pt[172]ga[172]100[170].5)[173]100
270 bo[178]2:bg[178]2:ch[178]1:[141]3100
280 [153]"load":[153][163]5)" left$arvest (NULL)ime on the ascarm wait
290 gosub3020:print"[195]rop[146] [211]elling price[146] [217]ield[146]
300 [129]j[178]1[164]3:rr[178]ta(j):[139]rr[178]0[167]rr[178]1
310 tm[178]yp(j):[141]3030:yp$[178]tm$:yp(j)[178][197](tm$)
320 tm[178]ty(j):[141]3030:ty$[178]tm$:ty(j)[178][197](tm$)
330 [153]n$(j);[163]13)yp$;[163]33[171][195](ty$))[181](ty(j)):[130]
340 [153]"right$t is now time to pay your bills and to sell your crops.":[141]3010
350 [153]"lenurrent peekank peekalance";:tm[178]ba:[141]3030:ba$[178]tm$:ba[178][197](tm$)
360 [153][163]33[171][195](ba$))ba$
370 [153]"ascutures lenrop lenheck";:tm[178]fx:[141]3030:fx$[178]tm$:[153][163]33[171][195](fx$))fx$
380 [153]"(NULL)otal (NULL)ield";:tm[178]gt:[141]3030:gt$[178]tm$:gt[178][197](tm$)
390 [153][163]33[171][195](gt$))gt$
400 [153]"(NULL)oan (NULL)ayment str$ue";:tm[178][181]((lo[173]3)[172]100[170].5)[173]100:[141]3030
410 [153][163]33[171][195](tm$))tm$:lp[178][181]([197](tm$)[172]100[170].5)[173]100
420 [153]"left$arvesting lenosts";:tm[178]hv:[141]3030:hv$[178]tm$:[153][163]33[171][195](hv$))hv$
430 hv[178][181]([197](tm$)[172]100[170].5)[173]100
440 [153]"lenost for 200 atncres";:tm[178][181](ce[172]100[170].5)[173]100[172]200:[141]3030:ce$[178]tm$
450 [153][163]33[171][195](ce$))ce$
460 [153]"ascuel valxpense";:tm[178]pt:[141]3030:pt$[178]tm$:pt[178][181]([197](tm$)[172]100[170].5)[173]100
470 [153][163]33[171][195](pt$))pt$
480 [153]"(NULL)verhead valxpense";:tm[178]ov:[141]3030:ov$[178]tm$:[153][163]33[171][195](ov$))ov$
490 ov[178][181]([197](tm$)[172]100[170].5)[173]100
500 [153]"lenrop (NULL)torage ascees";:tm[178](12[172]sb[172]0.015):[141]3030:sb$[178]tm$
510 sb[178][181]([197](tm$)[172]100[170].5)[173]100
520 [153][163]33[171][195](sb$))sb$:[141]3010
530 [153]"(NULL)otal atnssets=wait";:tm[178]ba[170]fx[170]gt:[141]3030:aa$[178]tm$
540 [153][163]33[171][195](aa$))aa$
550 [153]"(NULL)otal str$ebits=wait";
560 tm[178]lp[170]hv[170]ov[170]pt[170]sb[170](ce[172]200):[141]3030:dt$[178]tm$:dt[178][197](tm$)
570 [153][163]33[171][195](dt$))dt$:[141]2940
580 [129]j[178]1[164]3:[139]ty(j)[178]0[167]730
590 [153]"loadleft$ow many bushels of ";n$(j);" do you wish":[153]"to sell?
600 print"[217]ou have a maximum of ";ty(j);" to sell.
610 fg[178]0:x$[178]"":[133]x$:[139]x$[178]""[167]590
620 x[178][197](x$)
630 [139]x[177]ty(j)[167][153]"(NULL)ou don't have ";x;"bushels!":[141]3000:[137]590
640 [153]x;"bushels of ";n$(j);" would sell":[153]"for $";:tm[178]x[172]yp(j):[141]3030
650 [153]tm$:[141]3020
660 [153]"right$s ";x;"bushels of ";n$(j);" okay?
670 print"[208]ress f1[146] to change, f3[146] to sell
680 [141]2950
690 [139]a$[178][199](133)[167]590
700 [139]a$[179][177][199](134)[167]680
710 ba[178]ba[170]([181](x[172]yp(j)[172]100[170].5)[173]100)
720 sr(j)[178][181](ty(j)[171]x[170]sr(j))
730 [130]
740 ba[178][181]((ba[170]fx)[172]100[170].5)[173]100
750 [139]lo[178]0[167]850
760 [153]"loadleft$ow much of your loan do you
770 print"wish to pay off? [205]inimum payment
780 [153]"is $";:tm[178][181]((lo[173]3)[172]100[170].5)[173]100:[141]3030:[153]tm$
790 [153]"(NULL)ou owe a total of $";:lo[178][181](lo[172]100[170].5)[173]100:[153]lo
800 fg[178]0:[133]a
810 [139]a[179]tm[167][137]760
820 [139]a[177]lo[167]a[178]lo
830 ba[178][181]((ba[171]a)[172]100[170].5)[173]100:lo[178](lo[171]a)[172]1.12::lo[178][181](lo[172]100[170].5)[173]100
840 [139]lo[179]0[167]lo[178]0
850 ba[178]ba[171][181](ce[172]200[172]100[170].5)[173]100
860 ba[178]ba[171][181](ov[172]100[170].5)[173]100
870 ba[178]ba[171][181](hv[172]100[170].5)[173]100
880 ba[178]ba[171][181](pt[172]100[170].5)[173]100
890 ba[178]ba[171][181](sb[172]100[170].5)[173]100
900 [139]ba[179]0[167][141]2620
910 [129]j[178]1[164]3:ty(j)[178]0:[130]
920 [129]j[178]1[164]3:ts(j)[178]0:[130]:[130]
930 [153]"load":[153][163]5)" valnd of chr$ame (NULL)ally wait
940 print"[195]urrent [194]ank [194]alance = $";:tm=ba:gosub3030:printtm$:ba=val(tm$)
950 gosub3010
960 print"[195]rops in [211]torage:
970 [153]" lenrop wait peekushels in (NULL)torage wait
980 xx=0
990 forj=1to3:ifsr(j)<0thensr(j)=0
1000 printn$(j);:tm=sr(j):gosub3030
1010 printtab(22-len(tm$));int(sr(j)):xx=xx+sr(j)*yp(j):next
1020 print"[211]tored crop cash value:";:tm=xx:gosub3030
1030 printtab(35-len(tm$));"$"tm$:xx=val(tm$):ba=ba+xx
1040 print"[193]mount owed to [194]ank:";:tm=lo:gosub3030:printtab(35-len(tm$));"$"tm$
1050 lo=val(tm$):ba=ba-int(lo*100+.5)/100
1060 ifba>=20000thenzz=1
1070 ifba<20000thenzz=2
1080 print"[199]rand [212]otal in [194]ank:";:tm=ba:gosub3030:ba=val(tm$)
1090 printtab(35-len(tm$));"$"tm$:print
1100 onzzgosub2780,2820
1110 print"[215]ould you like to try again?
1120 [141]2950:[139]a$[178]"y"[167]10
1130 [139]a$[179][177]"n"[167]1120
1140 [128]
1150 [153]"load":bo[178]1:bg[178]1:ch[178]0:[141]3100
1160 [153][163]8)" (NULL)val(NULL)(NULL) (NULL)val(NULL)valatn(NULL)val ":[141]3020
1170 ir$[178][196]([181]((ir[171]1)[172]100))
1180 [153]"(NULL)early right$nflation (NULL)ate: ";[163]33)ir$;"%
1190 tm=ga:gosub3030:ga$=tm$:ga=val(tm$)
1200 print"[198]uel cost (per gallon) :";tab(33-p)"$"ga$
1210 tm=hs:gosub3030:hs$=tm$:hs=val(tm$)
1220 print"[200]erbicide cost per unit:";tab(33-p)"$"hs$
1230 tm=is:gosub3030:is$=tm$:is=val(tm$)
1240 print"[201]nsecticide cost per unit:";tab(33-p)"$"is$
1250 tm=ov:gosub3030:ov$=tm$:ov=val(tm$)
1260 print"[207]verhead costs:";tab(33-p)"$"ov$
1270 tm=ce:gosub3030:ce$=tm$
1280 print"[195]ost per acre:";tab(33-p)"$"ce$:gosub3010
1290 printtab(13)" [211]eed prices
1300 [153]"chr$rain seed cost per bushel
1310 forj=1to3:printn$(j);":";:tm=bs(j):gosub3030:bs(j)=val(tm$)
1320 printtab(33-p)"$"tm$:next:print:gosub3010
1330 printtab(10)" [198]utures [205]arket [208]rice ":print
1340 forj=1to3:printn$(j);":";:tm=bp(j)*fp(j):gosub3030
1350 printtab(33-p)"$"tm$:next:print
1360 gosub2940:return
1370 bo=2:bg=0:ch=1:gosub3100
1380 print"[147] [217]our [198]inancial [211]tatus ":gosub3010
1390 tm=ba:gosub3030:ba=val(tm$)
1400 print"[211]avings [193]ccount [194]alance:";tab(25-p)"$"ba
1410 tm=lo:gosub3030:lo=val(tm$)
1420 print"[217]ou owe the bank:";
1430 iflo=0thenprinttab(28)"------":goto1450
1440 printtab(25-p)"$"tm$
1450 print"":gosub3010:print" [195]rops presently in storage ":print:x=0
1460 printtab(9)"[195]rop";tab(20)"[194]ushels
1470 [129]j[178]1[164]3:[139]sr(j)[179]1.0[167]sr(j)[178]0
1480 [153][163]8)n$(j);[163]22)sr(j):x[178]x[170]sr(j):[130]
1490 [153]"chr$rain (NULL)torage ascee: $";:tm[178][181](x[172].015):[141]3030
1500 [153]tm$" per month.
1510 gosub2940:return
1520 bo=5:bg=5:ch=1:gosub3100
1530 print"[147]";tab(5)" [208]lanting [212]ime [207]n the [198]arm
1540 [153]"(NULL)ou have 200 acres to plant,divided into";
1550 [153]"5 fields of 40 acres each.
1560 print"[198]ields 1-3 are average or s